Skip to content

Add postCodeReviewResults.sh to claude-review-toolkit#66

Closed
kacper-mikolajczak wants to merge 1 commit into
Expensify:mainfrom
kacper-mikolajczak:slice2-toolkit-postCodeReviewResults
Closed

Add postCodeReviewResults.sh to claude-review-toolkit#66
kacper-mikolajczak wants to merge 1 commit into
Expensify:mainfrom
kacper-mikolajczak:slice2-toolkit-postCodeReviewResults

Conversation

@kacper-mikolajczak
Copy link
Copy Markdown
Contributor

Details

Adds a new helper script to the claude-review-toolkit composite action that centralises the violations post-processing loop currently duplicated across the three client claude-review.yml workflows (Expensify/App, Expensify/Auth, Expensify/Web-Expensify).

Behaviour preserved exactly:

  • Reads STRUCTURED_OUTPUT from env, takes PR_NUMBER as positional arg
  • 0 violations -> addPrReaction.sh "$PR_NUMBER" "+1"
  • N violations -> N createInlineComment.sh calls (one per violation, individual failures swallowed with || true)
  • Empty/missing STRUCTURED_OUTPUT -> ::error:: annotation + exit 1
  • Strict positional-arg validation (non-numeric PR_NUMBER rejected)

After this lands, the three client workflows can replace their inline jq + while-loop block with a single postCodeReviewResults.sh "$PR_NUMBER" call. The client adoption PRs follow this one.

This is slice 2 of the centralisation effort tracked in https://github.com/Expensify/Expensify/issues/635397.

Related Issues

https://github.com/Expensify/Expensify/issues/635397

Manual Tests

Smoke-tested locally with mocked addPrReaction.sh / createInlineComment.sh on PATH:

  • 0 violations -> single +1 reaction call
  • 2 violations -> 2 inline-comment calls with correct path/body/line args
  • Body containing backticks and embedded double-quotes -> preserved intact
  • Empty STRUCTURED_OUTPUT -> ::error:: + exit 1
  • Non-numeric PR_NUMBER -> error + exit 1
  • Missing PR_NUMBER -> usage + exit 1

End-to-end exercise comes from the client adoption PRs (linked below) running on real PRs of this repo.

Linked PRs

Client adoption PRs (drafts; reference this PR by placeholder SHA, re-stamped on merge):

  • Expensify/App PR (forthcoming)
  • Expensify/Auth PR (forthcoming)
  • Expensify/Web-Expensify PR (forthcoming)

Centralises the violations post-processing loop currently duplicated
across Expensify/App, Expensify/Auth, and Expensify/Web-Expensify's
claude-review.yml workflows. The script reads STRUCTURED_OUTPUT from
env, adds a +1 reaction when there are no violations, and otherwise
posts one inline comment per violation via createInlineComment.sh.
@kacper-mikolajczak
Copy link
Copy Markdown
Contributor Author

Superseded by #68 (consolidated slice 2 work into one PR per repo).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant